package com.etc.service.impl;

import java.util.List;

import com.etc.dao.CustomerDao;
import com.etc.dao.impl.CustomerDaoImpl;
import com.etc.entity.Customer;
import com.etc.entity.Discuss;
import com.etc.entity.Games;
import com.etc.entity.OrderMsg;
import com.etc.service.CustomerService;

public class CustomerServiceImpl implements CustomerService{
	private CustomerDao customerDao=new CustomerDaoImpl();
	@Override
	public Customer search(int id) {
		return customerDao.search(id);
	}
	@Override
	public int update(String nickname, String mobile, String password, int id) {
		// TODO Auto-generated method stub
		return customerDao.update(nickname, mobile, password,id);
	}
	@Override
	public List<OrderMsg> searchOrder(int id,int status) {
		
		
		return customerDao.searchOrder(id,status);
	}
	@Override
	public List<Games> searchGames(int id) {
		// TODO Auto-generated method stub
		return customerDao.searchGames(id);
	}
	@Override
	public int del(int id) {
		return customerDao.del(id);
		
	}
	@Override
	public int updatePassword(String querenmima, int id) {
		// TODO Auto-generated method stub
		return customerDao.updatePassword(querenmima,id);
	}
	@Override
	public List<Discuss> searchDiscuss(int id) {
		// TODO Auto-generated method stub
		return customerDao.searchDiscuss(id);
	}
	@Override
	public List<OrderMsg> searchOrderChao(int id, int status) {
		// TODO Auto-generated method stub
		return customerDao.searchOrderChao(id,status);
	}
	


	@Override
	public boolean addCustomer(Customer customer) {
		return customerDao.insert(customer)>0;
		
	}

	@Override
	public Customer findCustomerByMobile(String customermobile) {
		// TODO Auto-generated method stub
		Customer customer = customerDao.findByMobile(customermobile);
		return customer;
	}

	@Override
	public Customer findCustomerByNickname(String customernickname) {
		// TODO Auto-generated method stub
		Customer customer = customerDao.findByNickname(customernickname);
		return customer;
	}

}
